package com.goldmantis.alitrip.common.sysenum;

/**
 * @Author:Shmily
 * @Description: 方法的操作类型
 * @Date:Create in 11:13 2018/2/26
 */
public enum EnumOperationType {

    other(0,"其他"),
    login(1,"登陆"),
    logout(2,"退出"),
    query(3,"查询"),
    leave(4,"离开"),
    add(5,"新增"),
    edit(6,"修改"),
    delete(7,"删除"),
    submit(8,"提交"),
    exception(9,"异常"),
    appLogin(10,"移动端登陆"),
    grant(11,"授权"),
    revoke(12,"撤回");


    EnumOperationType(Integer value, String text) {
        this.value = value;
        this.text = text;
    }

    private Integer value;

    private String text;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public static String getTextByValue(Integer value){
        for(EnumOperationType operationType : EnumOperationType.values()) {
            if(operationType.getValue().intValue()==value.intValue()){
                return operationType.getText();
            }
        }
        return null;
    }
}
